'use strict';


/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  /**
   * 管理员
   */
  //登录
  router.post('/cms/admins/login', controller.admin.login);
  //修改密码
  router.post('/cms/admins/password', controller.admin.password);
  //列表
  router.get('/cms/admins', controller.admin.list);
  //新增
  router.post('/cms/admins', controller.admin.add);
  //编辑
  router.put('/cms/admins/:id', controller.admin.edit); 
  //删除
  router.delete('/cms/admins/:id', controller.admin.delete); 

  /**
   * 价格
   */
  //列表
  router.get('/cms/prices', controller.price.list);
  //新增
  router.post('/cms/prices', controller.price.add);
  //编辑
  router.put('/cms/prices/:id', controller.price.edit); 
  //删除
  router.delete('/cms/prices/:id', controller.price.delete); 
  
  /**
   * 轮播图
   */
  //列表
  router.get('/cms/banners', controller.banner.list);
  //新增
  router.post('/cms/banners', controller.banner.add);
  //编辑
  router.put('/cms/banners/:id', controller.banner.edit); 
  //删除
  router.delete('/cms/banners/:id', controller.banner.delete); 
  //切换是否显示
  router.get('/cms/banners/:id/online', controller.banner.online);
  
  /**
   * 分类
   */
  //列表
  router.get('/cms/catogories', controller.category.list);
  //新增
  router.post('/cms/catogories', controller.category.add);
  //编辑
  router.put('/cms/catogories/:id', controller.category.edit); 
  //删除
  router.delete('/cms/catogories/:id', controller.category.delete); 
  //切换是否显示
  router.get('/cms/catogories/:id/online', controller.category.online); 
  //切换是否推荐
  router.get('/cms/catogories/:id/recommend', controller.category.recommend); 

  /**
   * 话题
   */
  //列表
  router.get('/cms/themes', controller.theme.list);
  //详情
  router.get('/cms/themes/:id', controller.theme.detail); 
  //删除
  router.delete('/cms/themes/:id', controller.theme.delete); 
  //切换是否显示
  router.get('/cms/themes/:id/online', controller.theme.online); 
  //切换是否推荐
  router.get('/cms/themes/:id/recommend', controller.theme.recommend); 

  /**
   * 评论
   */
  //列表
  router.get('/cms/comments', controller.comment.list);
  //删除
  router.delete('/cms/comments/:id', controller.comment.delete); 
  //切换是否显示
  router.get('/cms/comments/:id/online', controller.comment.online); 
  //切换是否热门
  router.get('/cms/comments/:id/hot', controller.comment.hot); 

  /**
   * 回复
   */
  //列表
  router.get('/cms/replies', controller.reply.list);
  //删除
  router.delete('/cms/replies/:id', controller.reply.delete); 
  //切换是否显示
  router.get('/cms/replies/:id/online', controller.reply.online);

  /**
   * 开通VIP订单
   */
  //列表
  router.get('/cms/order-vip', controller.vipOrder.list);
  //编辑
  router.put('/cms/order-vip/:id', controller.vipOrder.edit); 
  //删除
  router.delete('/cms/order-vip/:id', controller.vipOrder.delete); 

  /**
   * 购买超喜欢订单
   */
  //列表
  router.get('/cms/order-like', controller.likeOrder.list);
  //编辑
  router.put('/cms/order-like/:id', controller.likeOrder.edit); 
  //删除
  router.delete('/cms/order-like/:id', controller.likeOrder.delete); 

  /**
   * 问答例子
   */
  //列表
  router.get('/cms/questions', controller.question.list);
  //新增
  router.post('/cms/questions', controller.question.add);
  //编辑
  router.put('/cms/questions/:id', controller.question.edit); 
  //删除
  router.delete('/cms/questions/:id', controller.question.delete); 

  /**
   * 用户
   */
  //列表
  router.get('/cms/users', controller.user.list);
  //详情
  router.get('/cms/users/:id', controller.user.detail); 
  //删除
  router.delete('/cms/users/:id', controller.user.delete); 
  //身份审核
  router.get('/cms/users/:id/identity', controller.user.identity); 
  //学历审核
  router.get('/cms/users/:id/education', controller.user.education); 
  

};
